﻿using CommunityToolkit.Mvvm.ComponentModel;
using MetaView.Shell.Common;
using System.Collections.ObjectModel;
using System.Windows.Media.Imaging;
using Wpf.Ui.Controls;

namespace MetaView.Shell.Models.Windows
{
    public partial class MainWindowModel : ObservableObject
    {
        [ObservableProperty]
        private string applicationTitle;

        [ObservableProperty]
        private string moduleTitle;

        [ObservableProperty]
        private ObservableCollection<object> menuItems;

        [ObservableProperty]
        private ObservableCollection<object> footerMenuItems;

        public MainWindowModel()
        {
            ApplicationTitle = "元景票务系统";
            ModuleTitle = "控制台";

            #region 初始化菜单栏

            MenuItems = new()
            {
                new NavigationViewItem()
                {
                    Content = "控制台",
                    Icon = new ImageIcon
                    {
                        Source = new BitmapImage(new Uri("pack://application:,,,/MetaView.Shell;component/Assets/home.png",UriKind.Absolute)),
                        Height = 24,
                        Width = 24
                    },
                    TargetPageType = typeof(Views.Pages.DashboardPage)
                },
                new NavigationViewItem()
                {
                    Content = "售票",
                    TargetPageTag = "sell-ticket",
                    ToolTip = "门票售票",
                    //Icon = new SymbolIcon { Symbol = SymbolRegular.CalculatorMultiple24 },
                    Icon = new ImageIcon
                    {
                        Source = new BitmapImage(new Uri("pack://application:,,,/MetaView.Shell;component/Assets/sell-ticket.png",UriKind.Absolute)),
                        Height = 24,
                        Width = 24
                    },
                    TargetPageType = typeof(Views.Pages.DataPage),
                },
                new NavigationViewItem()
                {
                    Content = "票管理",
                    Icon = new ImageIcon
                    {
                        Source = new BitmapImage(new Uri("pack://application:,,,/MetaView.Shell;component/Assets/manage-ticket.png",UriKind.Absolute)),
                        Height = 24,
                        Width = 24
                    },
                    TargetPageType = typeof(Views.Pages.DataPage)
                },
                new NavigationViewItem()
                {
                    Content = "开卡",
                    Icon = new ImageIcon
                    {
                        Source = new BitmapImage(new Uri("pack://application:,,,/MetaView.Shell;component/Assets/sell-card.png",UriKind.Absolute)),
                        Height = 24,
                        Width = 24
                    },
                    TargetPageType = typeof(Views.Pages.DataPage),

                },
                new NavigationViewItem()
                {
                    Content = "卡管理",
                    Icon = new ImageIcon
                    {
                        Source = new BitmapImage(new Uri("pack://application:,,,/MetaView.Shell;component/Assets/manage-card.png",UriKind.Absolute)),
                        Height = 24,
                        Width = 24
                    },
                    TargetPageType = typeof(Views.Pages.DataPage),

                },
                new NavigationViewItem()
                {
                    Content = "交易",
                    Icon = new ImageIcon
                    {
                        Source = new BitmapImage(new Uri("pack://application:,,,/MetaView.Shell;component/Assets/trade-search.png",UriKind.Absolute)),
                        Height = 24,
                        Width = 24
                    },
                    TargetPageType = typeof(Views.Pages.DataPage),

                },
                new NavigationViewItem()
                {
                    Content = "核销",
                    Icon = new ImageIcon
                    {
                        Source = new BitmapImage(new Uri("pack://application:,,,/MetaView.Shell;component/Assets/write-off.png",UriKind.Absolute)),
                        Height = 24,
                        Width = 24
                    },
                    TargetPageType = typeof(Views.Pages.DataPage),

                },
                new NavigationViewItem()
                {
                    Content = "交班",
                    Icon = new ImageIcon
                    {
                        Source = new BitmapImage(new Uri("pack://application:,,,/MetaView.Shell;component/Assets/handover.png",UriKind.Absolute)),
                        Height = 24,
                        Width = 24
                    },
                    TargetPageType = typeof(Views.Pages.DataPage),

                }
            };

            FooterMenuItems = new()
            {
                new NavigationViewItem()
                {
                    Content = "模板",
                    Icon = new ImageIcon
                    {
                        Source = new BitmapImage(new Uri("pack://application:,,,/MetaView.Shell;component/Assets/temp.png",UriKind.Absolute)),
                        Height = 24,
                        Width = 24
                    },
                    TargetPageType = typeof(Views.Pages.DataPage),

                },
                new NavigationViewItem()
                {
                    Content = "设置",
                    Icon = new ImageIcon
                    {
                        Source = new BitmapImage(new Uri("pack://application:,,,/MetaView.Shell;component/Assets/set.png",UriKind.Absolute)),
                        Height = 24,
                        Width = 24
                    },
                    TargetPageType = typeof(Views.Pages.SettingsPage)
                },
                new NavigationViewItem()
                {
                    Content = "用户",
                    Icon = new ImageIcon
                    {
                        Source = new BitmapImage(new Uri("pack://application:,,,/MetaView.Shell;component/Assets/user.png",UriKind.Absolute)),
                        Height = 24,
                        Width = 24
                    },
                    TargetPageType = typeof(Views.Pages.SettingsPage)
                }
            };

            #endregion
        }
    }
}
